package com.drojian.demo1.test5;

import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import com.drojian.demo.R;

public class AlertDiaLogActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.ui5_activity_alert_dia_log);
        Button back = findViewById(R.id.back);
        back.setOnClickListener(v->finish());
        Button alert = findViewById(R.id.alert_btn1);
        alert.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //创建提醒对话框的建造器
                AlertDialog.Builder builder = new AlertDialog.Builder(AlertDiaLogActivity.this);
                //设置对话框的标题文本
                builder.setTitle("尊敬的用户");
                //设置对话框的文本内容
                builder.setMessage("刷新频繁");
                //设置对话框的肯定按钮文本及其点击监听器
                builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                });
                // 设置否定按钮文本及其点击监听器
                builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                });
                //显示提醒对话框
                builder.show();

            }
        });

    }
}